import tkinter as tk
import tkinter.messagebox

window = tk.Tk()
window.title('my window')
##窗口尺寸
window.geometry('200x200')


def hit_me():
    # tk.messagebox.showinfo(title='',message='')#提示信息对话窗
    # tk.messagebox.showwarning()#提出警告对话窗
    # tk.messagebox.showerror()#提出错误对话窗
    # tk.messagebox.askquestion(title='Hi', message='hahahaha')#询问选择对话窗
    print(tk.messagebox.askquestion(title='Hi', message='hahahaha'))  # 打印出我们所选项对应的值


tk.Button(window, text='Hit me', command=hit_me).pack()

##显示出来
window.mainloop()

